package dhee.wtqshopproject.utils;

import dhee.wtqshopproject.entity.Admin;

public class AdminThread {
    private static final ThreadLocal<Admin> userHolder = new ThreadLocal<>();

    // 存储用户信息
    public static void setCurrentUser(Admin admin) {
        userHolder.set(admin);
    }

    // 获取用户信息
    public static Admin getCurrentUser() {
        return userHolder.get();
    }

    // 清除用户信息
    public static void remove() {
        userHolder.remove();
    }
}
